#ifndef BC2CA8EA_10E8_42AA_AE7D_69DC9AEB8649
#define BC2CA8EA_10E8_42AA_AE7D_69DC9AEB8649

#include <pthread.h>
#include <thread>
#include <iostream>

using namespace std;

class Mutex{
public:
	Mutex(pthread_mutex_t* mutex):
	_mutex(mutex)
	{}
	~Mutex()
	{}
	void Lock()
	{
		pthread_mutex_lock(_mutex);
	}
	void Unlock(){
		pthread_mutex_unlock(_mutex);
	}
private:
	pthread_mutex_t* _mutex;
};

class LockGuard{
public:
	LockGuard(pthread_mutex_t* mutex):
	_lock(mutex)
	{
		_lock.Lock();
	}
	~LockGuard()
	{
		_lock.Unlock();
	}
private:
	Mutex _lock;
};


#endif /* BC2CA8EA_10E8_42AA_AE7D_69DC9AEB8649 */
